#!/bin/bash

set -e # exit on error
set -x # echo commands

if  [[ -z "${TRAVIS_TAG}" ]]; then
    echo
    echo "SKIPPING DEPLOY STAGE SCRIPT--- This is a NOT build for a release tag"
    echo
    exit 0
fi

echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > bokehjs/.npmrc

# build BokehJS and install, build_upload script assumes this
python setup.py --quiet install --build-js

# run the build_upload script to deploy a release
python scripts/build_upload.py $TRAVIS_TAG
